package com.gg.user.gguser.dao;

import com.gg.user.gguser.dataobject.GgItemsOnlyDataobject;
import org.apache.ibatis.annotations.*;

@Mapper
public interface GgItemsOnlyDaoMapper {

    @Insert("insert into gg_items_only(gg_io_only, gg_id, gg_io_type) values(REPLACE(UUID(),\"-\",\"\"),#{ggItemsOnlyDataobject.ggId},#{ggItemsOnlyDataobject.ggIoType})")
    @Options(useGeneratedKeys=true, keyProperty="ggItemsOnlyDataobject.id",keyColumn = "id")
    Integer addInformation(@Param("ggItemsOnlyDataobject") GgItemsOnlyDataobject ggItemsOnlyDataobject);

    @Select("select id as id ,gg_io_only as ggIoOnly,gg_io_type as ggIoType,gg_id as ggId from gg_items_only where id = #{id}")
    GgItemsOnlyDataobject getInformation(@Param("id") Integer id);
}
